<template>
	<view class="" :style="skin">
		<jnavbar :title="'订单详情'"></jnavbar>
		<!--订单支付页面 单商品-->
		<block v-if="type == 0">
			<scroll-view class="page_container" scroll-y>
				<!-- 自提or快递or同城 -->
				<view class="adress_div">
					<view class="tabs">
						<view v-for="(item, index) in sendinfo" :key="index" @click="changetabs(index)" :class="[tabIndex == index ? 'active' : '']">
							<text>{{ item.name }}</text>
						</view>
					</view>
					<view class="adresslist">
						<swiper :current="tabIndex" @change="changeTab" class="uni-swiper">
							<block v-for="(item, index) in sendinfo" :key="index">
								<swiper-item v-if="item.type == '1'">
									<view class="address_info uni-flex-row uni-flex-title" @click="getAddress(address)">
										<view class="u-flex">
											<view class="icon_div"><text class="el-sc-dingwei iconfont"></text></view>
											<view class="uni-flex-column u-flex-1" v-if="address">
												<view class="add_name">
													<text>{{ address.consignee }}</text>
													<text>{{ address.iphone }}</text>
												</view>
												<text class="add_content">{{ address.address.replace(/,/g, '') }}</text>
											</view>
											<view class="use" v-else><text>选择地址</text></view>
										</view>

										<text class="el-sc-xiangyou iconfont"></text>
									</view>
								</swiper-item>
								<swiper-item v-if="item.type == '2'">
									<view class="address_info uni-flex-row uni-flex-title" @click="selectstore(commoditys, 2)">
										<view class="u-flex">
											<view class="icon_div"><text class="el-sc-dingwei iconfont"></text></view>
											<view class="uni-flex-column u-flex-1">
												<text class="add_name">{{ selectstoredata.name }}</text>
												<text>{{ selectstoredata.district.replace(/ /g, '') }}{{ selectstoredata.address }}</text>
											</view>
										</view>

										<text class="el-sc-xiangyou iconfont"></text>
									</view>
								</swiper-item>
								<swiper-item v-if="item.type == '3'">
									<view class="address_info uni-flex-row uni-flex-title" @click="getAddress(address)">
										<view class="u-flex">
											<view class="icon_div"><text class="el-sc-dingwei iconfont"></text></view>
											<view class="uni-flex-column u-flex-1" v-if="address">
												<view class="add_name">
													<text>{{ address.consignee }}</text>
													<text>{{ address.iphone }}</text>
												</view>
												<text class="add_content">{{ address.address.replace(/,/g, '') }}</text>
											</view>
											<view class="use" v-else><text>选择地址</text></view>
										</view>

										<text class="el-sc-xiangyou iconfont"></text>
									</view>
								</swiper-item>
							</block>
						</swiper>
					</view>
					<view v-if="mysendtype == 3" class="adresslist">
						<view class="address_info uni-flex-row uni-flex-title" @click="selectstore(commoditys, 3)">
							<view class="u-flex">
								<view class="icon_div"><text class="el-sc-dingwei iconfont"></text></view>
								<view class="uni-flex-column u-flex-1">
									<text class="add_name">{{ selectstoredata_city.name }}</text>
									<text>{{ selectstoredata_city.district.replace(/ /g, '') }}{{ selectstoredata_city.address }}</text>
								</view>
							</view>

							<text class="el-sc-xiangyou iconfont"></text>
						</view>
					</view>
				</view>

				<u-form class="user_info uni-block-form uni-view uni-flex-column" v-if="is_all_store" :model="form" :label-width="180" ref="uForm">
					<u-form-item class="item" label="姓名"><u-input placeholder="请输入自提人姓名" v-model="form.consignee" /></u-form-item>
					<u-form-item class="item" label="手机号码"><u-input placeholder="请输入自提人手机号码" v-model="form.iphone" /></u-form-item>
				</u-form>
				<view class="goods_list weizhi goods_div">
					<view class="uni-flex-row uni-flex-title ">
						<vimage class="img_box" :src="commoditys.master" mode=""></vimage>
						<view class="goods_content uni-flex-column">
							<text class="u-main-color u-line-2">{{ commoditys.name }}</text>
							<text class="u-tips-color u-line-1">{{ commoditys.pvs_value || '' }}</text>
						</view>
						<view class="goods_price uni-flex-column">
							<text>￥{{ commoditys.price }}x{{ commoditys.num }}</text>
						</view>
					</view>
					<view class="attach-txt">
						<view class="u-flex u-row-between attach-item" v-for="(data, i) in commoditys.attach" :key="i">
							<text class="u-main-color">{{ data.pname + ':' + data.name }}</text>
							<text class="attach-price u-tips-color">￥{{ data.price }}x{{ commoditys.num }}</text>
						</view>
					</view>
				</view>
				<view class="form_div">
					<view v-for="(item, index) in commoditys.form_list" :key="index"><customfrom @outdata="outdata_ones($event, index)" :mydata="item"></customfrom></view>
				</view>
				<view class="good_box">
					<u-cell-group :border="false">
						<u-cell-item :border-bottom="false" v-if="addons.indexOf(3) > -1 && commoditys.has_coupon" @click="opencoupon(commoditys, -1)" title="优惠券">
							<text class="coupontxt" v-if="commoditys.coupon && commoditys.coupon.id">-￥{{ commoditys.coupon.denomination }}</text>
							<text v-else>不使用优惠券</text>
						</u-cell-item>
						<u-cell-item hover-class="none" :arrow="false" title="商品金额">
							<text slot="right-icon">￥{{ commoditys | getallprice }}</text>
						</u-cell-item>
						<u-cell-item hover-class="none" :arrow="false" title="运费" :value="'￥' + freightall"></u-cell-item>
						<u-cell-item hover-class="none" :arrow="false" title="优惠" :value="'￥' + couponprice"></u-cell-item>
						<block v-if="integralprice > 0">
							<u-cell-item hover-class="none" :arrow="false" :title="'剩余' + integralBalance.integral_text">
								<text slot="right-icon">{{ UserInfo.integral }}</text>
								<text slot="right-icon" class="coupontxt" v-if="is_integral">-{{ integral }}</text>
							</u-cell-item>
							<u-cell-item hover-class="none" :arrow="false" :title="integralBalance.integral_text + '抵扣'" value="">
								<u-switch :size="40" slot="right-icon" v-model="is_integral"></u-switch>
							</u-cell-item>
							<u-cell-item hover-class="none" :arrow="false" title="抵扣金额" v-if="is_integral" :value="'-￥' + integralprice"></u-cell-item>
						</block>
						<u-cell-item v-if="mysendtype != 1" hover-class="none" @click="showtime = true" :arrow="false" title="配送/自提时间">
							<view slot="right-icon">
								<text>{{ delivery_time }}</text>
								<u-icon name="arrow-right"></u-icon>
							</view>
							<!-- <u-picker @confirm="gettime" v-model="showtime" mode="time" :params="params_time"></u-picker> -->
						</u-cell-item>
						<u-cell-item hover-class="none" :arrow="false">
							<view slot="right-icon" class="">
								<text>实付款</text>
								<text class="pay_price">￥{{ allprice }}</text>
							</view>
						</u-cell-item>
					</u-cell-group>
				</view>
				<view class="form_div">
					<view v-for="(item, index) in order_form_list" :key="index"><customfrom @outdata="outdata($event, index)" :mydata="item"></customfrom></view>
				</view>
				<view class="goodinfo weizhi">
					<text>备注</text>
					<u-input type="textarea" v-model="remake" placeholder="备注信息"></u-input>
				</view>
				<u-gap height="140"></u-gap>
			</scroll-view>
			<view class="footer u-flex u-row-between" v-bind:class="show_empty ? 'top_50' : ''">
				<view class="allprice">
					<text>合计</text>
					<text class="pay_price">￥{{ allprice }}</text>
				</view>
				<view class="btns"><u-button type="primary" shape="circle" size="medium" @click="createOrder()">立即支付</u-button></view>
			</view>
		</block>
		<!-- 订单 多商品 -->
		<block v-else-if="type == 1">
			<scroll-view class="page_container" scroll-y>
				<!-- <u-gap height="30" bg-color="#bbb"></u-gap>
					<view class="banner"></view> -->
				<block v-if="sendtype == 'self' || sendtype == 'all'">
					<u-form class="user_info uni-block-form uni-view uni-flex-column" v-if="is_all_store" :model="form" :label-width="180" ref="uForm">
						<u-form-item class="item" label="姓名"><u-input placeholder="请输入自提人姓名" v-model="form.consignee" /></u-form-item>
						<u-form-item class="item" label="手机号码"><u-input placeholder="请输入自提人手机号码" v-model="form.iphone" /></u-form-item>
					</u-form>
				</block>

				<block v-if="sendtype == 'send' || sendtype == 'all' || sendtype == 'city'">
					<view class="adress_div" v-if="!is_all_store">
						<!-- <view class="tabs">
								<view class="active"><text>快递</text></view>
							</view> -->
						<view class="adresslist">
							<swiper :current="tabIndex" @change="changeTab">
								<swiper-item>
									<view class="address_info uni-flex-row uni-flex-title" @click="getAddress(address)">
										<view class="u-flex">
											<view class="icon_div"><text class="el-sc-dingwei iconfont"></text></view>
											<view class="uni-flex-column" v-if="address">
												<view class="add_name">
													<text>{{ address.consignee }}</text>
													<text>{{ address.iphone }}</text>
												</view>
												<text class="add_content">{{ address.address.replace(/,/g, '') }}</text>
											</view>
											<view class="use" v-else><text>选择地址</text></view>
										</view>
										<text class="el-sc-xiangyou iconfont"></text>
									</view>
								</swiper-item>
							</swiper>
						</view>
					</view>
				</block>
				<view v-for="(data, i) in commoditys" :key="i" class="goods_list">
					<view class="uni-flex-row uni-flex-title merchantName">
						<text v-if="mallBaseinfo">{{ data.merchantId == 1 ? mallBaseinfo.mall_name : data.merchantName }}</text>
					</view>
					<view class=" goods_div" v-for="(item, a) in data.list" :key="a">
						<view class="uni-flex-row uni-flex-title ">
							<vimage class="img_box" :src="item.master" mode=""></vimage>
							<view class="goods_content uni-flex-column">
								<text class="u-main-color u-line-2">{{ item.name }}</text>
								<text class="u-tips-color u-line-1">{{ item.pvs_value || '' }}</text>
							</view>
							<view class="goods_price uni-flex-column">
								<text>￥{{ item.price }}x{{ item.num }}</text>
							</view>
						</view>
						<view class="attach-txt">
							<view class="u-flex u-row-between attach-item" v-for="(data, i) in item.attach" :key="i">
								<text class="u-main-color">{{ data.act.name + ':' + data.name }}</text>
								<text class="attach-price u-tips-color">￥{{ data.price }}x{{ item.num }}</text>
							</view>
						</view>
						<view class="form_div_cart">
							<view v-for="(item, c) in item.form_list" :key="c"><customfrom @outdata="outdata_arry($event, [c, a, i])" :mydata="item"></customfrom></view>
						</view>
					</view>
					<view class="good_box" style="padding: 0;">
						<u-cell-group :border="false">
							<u-cell-item :border-bottom="false" v-if="addons.indexOf(3) > -1" @click="opencoupon(data, i)" title="优惠券" :arrow="false">
								<view slot="right-icon">
									<text class="coupontxt" v-if="data.coupon && data.coupon.id">-￥{{ data.coupon.denomination }}</text>
									<text v-else>不使用优惠券</text>
									<u-icon name="arrow-right"></u-icon>
								</view>
							</u-cell-item>
							<!-- <u-cell-item hover-class="none" :arrow="false" v-if="sendtype == 'all'" title="是否自提" value="">
								<u-switch :size="40" slot="right-icon" v-model="data.is_store"></u-switch>
							</u-cell-item> -->
							<u-cell-item :border-bottom="false" @click="selecttype(data, i)" hover-class="none" :arrow="false" v-if="sendtype == 'all'" title="提取方式" value="">
								<view slot="right-icon">
									<text v-if="data.sendtype != 0">{{ sendname[data.sendtype] }}</text>
									<text v-else>选择方式</text>
									<u-icon name="arrow-right"></u-icon>
								</view>
							</u-cell-item>
							<u-cell-item
								:border-bottom="false"
								@click="selectstore(data)"
								:title="sendname[data.sendtype]"
								v-if="data.sendtype == 2 || data.sendtype == 3"
								:arrow="false"
							>
								<view slot="right-icon">
									<text v-if="data.name">{{ data.name }}</text>
									<text v-else>选择门店</text>
									<u-icon name="arrow-right"></u-icon>
								</view>
							</u-cell-item>
						</u-cell-group>
					</view>
				</view>
				<view class="good_box">
					<u-cell-group>
						<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" title="合计" :value="'￥' + goodsprice"></u-cell-item>
						<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" title="运费" :value="'￥' + freightall"></u-cell-item>
						<u-cell-item :border-bottom="false" hover-class="none" :arrow="false" title="优惠" :value="'￥' + couponprice"></u-cell-item>
						<block v-if="integralprice > 0">
							<u-cell-item hover-class="none" :arrow="false" :title="'剩余' + integralBalance.integral_text">
								<text slot="right-icon">{{ UserInfo.integral }}</text>
								<text slot="right-icon" class="coupontxt" v-if="is_integral">-{{ integral }}</text>
							</u-cell-item>
							<u-cell-item hover-class="none" :arrow="false" :title="integralBalance.integral_text + '抵扣'" value="">
								<u-switch :size="40" slot="right-icon" v-model="is_integral"></u-switch>
							</u-cell-item>
							<u-cell-item hover-class="none" :arrow="false" v-if="is_integral" title="抵扣金额" :value="'-￥' + integralprice"></u-cell-item>
						</block>
						<u-cell-item v-if="!is_all_address" hover-class="none" @click="showtime = true" :arrow="false" title="配送/自提时间">
							<view slot="right-icon">
								<text>{{ delivery_time }}</text>
								<u-icon name="arrow-right"></u-icon>
							</view>
							<!-- <u-picker @confirm="gettime" v-model="showtime" mode="time" :params="params_time"></u-picker> -->
						</u-cell-item>
						<u-cell-item hover-class="none" :arrow="false">
							<view slot="right-icon" class="">
								<text>实付款</text>
								<text class="pay_price">￥{{ allprice }}</text>
							</view>
						</u-cell-item>
					</u-cell-group>
				</view>
				<view class="form_div">
					<view v-for="(item, index) in order_form_list" :key="index"><customfrom @outdata="outdata($event, item)" :mydata="item"></customfrom></view>
				</view>
				<view class="goodinfo weizhi">
					<text>备注</text>
					<u-input type="textarea" v-model="remake" placeholder="备注信息"></u-input>
				</view>
				<u-gap height="140"></u-gap>
			</scroll-view>
			<view class="footer u-flex u-row-between" v-bind:class="show_empty ? 'top_50' : ''">
				<view class="allprice">
					<text>合计</text>
					<text class="pay_price">￥{{ allprice }}</text>
				</view>
				<view class="btns"><u-button type="primary" shape="circle" size="medium" @click="createOrder()">立即支付</u-button></view>
			</view>
		</block>
		<!--订单完成页面-->
		<block v-else-if="type == 2">
			<view class="page_container" scroll-y>
				<view class="status_div">
					<text class="status_text" v-if="showstatus">
						{{ orderdetail | getstatus(groupdetial) }}
						<text class="u-font-sm">{{ orderdetail.order_type == 3 ? '（同城）' : '' }}</text>
					</text>
					<vimage imgtype="1" class="image" src="static/images/self.png" mode=""></vimage>
				</view>
				<!-- 自提订单 -->
				<block v-if="orderdetail.order_type == 2">
					<view class="adress_div" @click="opmap">
						<view class="adresslist">
							<view class="address_info uni-flex-row uni-flex-title">
								<view class="uni-flex-column">
									<view class="add_name">
										<text>{{ orderdetail.consignee }}</text>
										<text>{{ orderdetail.iphone }}</text>
									</view>
									<view>
										<text style="margin-right: 20rpx;color: #333333;">{{ orderdetail.order_commodity[0].store.name }}</text>
										<text>{{ orderdetail.order_commodity[0].store.address.replace(/ /g, '') }}</text>
									</view>
								</view>
								<text class="el-sc-xiangyou iconfont"></text>
							</view>
						</view>
					</view>
				</block>
				<block v-else>
					<view class="adress_div">
						<view class="adresslist">
							<view class="address_info uni-flex-row ">
								<view class="uni-flex-column">
									<view class="add_name">
										<text>{{ orderdetail.consignee }}</text>
										<text>{{ orderdetail.iphone }}</text>
									</view>
									<view>
										<text class="el-sc-dingwei iconfont"></text>
										<text>{{ orderdetail.address ? orderdetail.address.replace(/,/g, '') : '' }}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
				</block>

				<view class="goods_list">
					<text class="title">订单商品</text>
					<view class="goods_div" v-for="(item, i) in orderdetail.order_commodity" :key="i">
						<view class="uni-flex-row u-relative">
							<!-- <vimage class="img_box" :src="commoditys.master" mode=""></vimage> -->
							<vimage class="img_box" @click="topdetail(item.commodity.id)" :src="item.commodity.master" mode=""></vimage>

							<view class="goods_content uni-flex-column">
								<text class="u-main-color u-line-2">
									<text class="group_div" v-if="item.collage">{{ item.collage }}人团</text>
									<text class="group_div" v-if="orderdetail.order_from == 2">秒杀</text>
									<text class="group_div" v-if="orderdetail.order_from == 3">预售</text>
									{{ item.commodity.name }}
								</text>
								<text class="u-tips-color u-line-1" v-if="item.sku">{{ item.sku.pvs_value || '' }}</text>
							</view>
							<view class="goods_price uni-flex-column">
								<text>￥{{ item.price }}x{{ item.count }}</text>
								<text>{{ item.status_text }}</text>
								<view class="goods_btns">
									<block v-if="collage_id">
										<view class="btns" v-if="item.is_open == 1 && groupdetial.status == 2" @click="aftersale(item.id)">申请售后</view>
									</block>
									<block v-if="!collage_id"><view class="btns" v-if="item.is_open == 1" @click="aftersale(item.id)">申请售后</view></block>

									<view
										class="btns"
										v-if="
											item.status != 4 &&
												item.status != 11 &&
												(item.after_status == '1' || (item.after_commodity && item.after_commodity[0] && item.after_commodity[0].order_after_id))
										"
										@click="toafterorder(item)"
									>
										售后详情
									</view>
									<view class="btns" v-if="item.status == 3 && orderdetail.order_type == 1" @click="gologistics(item)">查看物流</view>
								</view>
							</view>
						</view>
						<answer v-if="item.form && item.form.answer" :list="item.form.answer"></answer>
						<view v-if="item.attachlist" v-for="(data, i) in item.attachlist" class="u-content-color u-flex u-row-between u-font-sm u-margin-top-20">
							<text>{{ data.attach_value }}</text>
							<text>&yen;&nbsp;{{ data.attach_price }}x{{ item.count }}</text>
						</view>
					</view>
					<view class="goods_div">
						<view class="uni-flex-row uni-flex-title order_cell boldtext">
							<text>商品金额</text>
							<text>￥{{ orderdetail.money }}</text>
						</view>
						<view class="uni-flex-row uni-flex-title order_cell">
							<text>优惠券</text>
							<text>￥{{ orderdetail.discount }}</text>
						</view>
						<view class="uni-flex-row uni-flex-title order_cell">
							<text>积分抵扣</text>
							<text>￥{{ orderdetail.discount_amount }}</text>
						</view>
						<u-gap height="2" bg-color="#eee" margin-top="15" margin-bottom="15"></u-gap>
						<view class="uni-flex-row uni-flex-title order_cell">
							<text>运费</text>
							<text>￥{{ orderdetail.freight }}</text>
						</view>

						<view class="uni-flex-row uni-flex-title order_cell boldtext">
							<text>实付款</text>
							<text class="pay_price">￥{{ orderdetail.allprice }}</text>
						</view>
					</view>
				</view>
				<view class="order_detial">
					<text class="title">订单信息</text>
					<view class="uni-flex-row uni-flex-title order_cell">
						<text>订单编号</text>
						<view>
							<text>{{ orderdetail.order_no }}</text>
							<text class="mid-font fuzhi" @click="uniCopy(orderdetail.order_no)">复制</text>
						</view>
					</view>
					<view class="uni-flex-row uni-flex-title order_cell">
						<text>订单创建时间</text>
						<text>{{ orderdetail.create_time }}</text>
					</view>
					<view class="uni-flex-row uni-flex-title order_cell"></view>
				</view>
				<view
					class="order_detial"
					v-if="tradeSetting.is_invoice && orderdetail.status != 1 && orderdetail.status != 2 && orderdetail.status != 6 && orderdetail.status != 12"
				>
					<text class="title">发票信息</text>
					<view class="uni-flex-row uni-flex-title order_cell">
						<text style="color: #999;">开具发票</text>
						<view @click="todetail()">
							<text>{{ invoiceStatus }}</text>
							<u-icon name="arrow-right"></u-icon>
						</view>
					</view>
				</view>
				<view class="order_detial" v-if="orderdetail.form && orderdetail.form.answer">
					<text class="title">表单信息</text>
					<answer v-if="orderdetail.form && orderdetail.form.answer" :list="orderdetail.form.answer"></answer>
				</view>

				<view class="order_detial" v-if="orderdetail.remake">
					<text class="title">备注</text>
					<view class="uni-flex-row uni-flex-title order_cell">
						<view>
							<text>{{ orderdetail.remake }}</text>
						</view>
					</view>
				</view>

				<guesslike></guesslike>
				<u-gap height="140"></u-gap>
			</view>
			<view class="footer u-flex u-row-between" v-bind:class="show_empty ? 'top_50' : ''">
				<view class="allprice">
					<text>合计：</text>
					<text class="pay_price">￥{{ orderdetail.allprice }}</text>
				</view>
				<view class="btns">
					<u-button type="primary" size="mini" shape="circle" @click="togroupdetail" v-if="collage_id">团队详情</u-button>
					<block v-if="collage_id">
						<u-button type="primary" size="mini" shape="circle" @click="aftersale('all')" v-if="orderdetail.is_open == 1 && groupdetial.status == 2">申请售后</u-button>
					</block>
					<block v-if="!collage_id">
						<u-button type="primary" size="mini" shape="circle" @click="aftersale('all')" v-if="orderdetail.is_open == 1">申请售后</u-button>
					</block>

					<u-button type="primary" size="mini" shape="circle" @click="topay" v-if="orderdetail.status == 1">立即支付</u-button>
					<u-button
						type="primary"
						size="mini"
						shape="circle"
						@click="bf_orderconfirm()"
						v-if="orderdetail.status == 3 || orderdetail.status == 7 || orderdetail.send == 1"
					>
						确认收货
					</u-button>
					<u-button
						type="primary"
						size="mini"
						shape="circle"
						@click="evaluateOrder()"
						v-if="orderdetail.status == 8 && tradeSetting.order_evaluate == 1 && orderdetail.is_evaluate == 0"
					>
						订单评价
					</u-button>
					<u-button type="primary" size="mini" shape="circle" @click="showpup" v-if="orderdetail.status == 2 && orderdetail.order_type == 2">核销订单</u-button>
				</view>
			</view>
		</block>
		<view class="l-gap" v-if="show_empty"></view>
		<!--退款申请页面-->
		<!-- 核销弹窗 -->
		<u-popup ref="popup" v-model="showPopupBottom" mode="bottom">
			<view class="list uni-flex-column u-p-20">
				<scroll-view class="popup_div" scroll-y>
					<view class="item uni-flex-row" v-for="(item, i) in veriflist" :key="i">
						<view class=""><u-checkbox shape="circle" v-model="item.checked" :disabled="item.status == 4"></u-checkbox></view>

						<view class="uni-flex-row">
							<vimage class="img_box" :src="item.master" mode=""></vimage>
							<view class="uni-flex-column info_text">
								<text class="u-main-color u-line-2">{{ item.commodity_name }}</text>
								<text class="u-tips-color">{{ item.pvs_value || '' }}</text>
								<text>x{{ item.count }}</text>
							</view>
						</view>
					</view>
				</scroll-view>
				<u-button :custom-style="customStyle" type="primary" size="medium" shape="circle" @click="buildqrcode">确认核销</u-button>
				<view class="l-gap-f" v-if="show_empty"></view>
			</view>
		</u-popup>
		<!-- 核销二维码 -->
		<u-popup v-model="showPopupCenter" mode="center" border-radius="20">
			<view class="qrcodediv">
				<view class="qrcode_top u-flex u-row-between">
					<text>二维码</text>
					<text @click="showPopupCenter = false" class="el-sc-cuo11"></text>
				</view>
				<image :src="qrcode" mode=""></image>
				<!-- <image :src="qrcode" mode=""></image> -->
				<text>扫描二维码，核销商品</text>
				<u-button type="primary" :custom-style="customStyle1" class="qrcode_btn" @click="saveimg(qrcode)">保存图片</u-button>
				<view class="l-gap-f" v-if="show_empty"></view>
			</view>
		</u-popup>
		<!-- 优惠券 -->
		<u-popup ref="conpon" v-model="showconpon" mode="bottom">
			<view class="u-p-l-40 u-p-r-40">
				<scroll-view class="couponlist u-m-t-20" scroll-y>
					<view v-if="availablelist.length > 0" class="item uni-flex-row" @click="selectcoupon(item)" v-for="item in availablelist">
						<view class="uni-flex-column uni-flex-column-center price sm-font">
							<text class="lg-font">￥{{ item.coupon.denomination }}</text>
							<text>满{{ item.coupon.conditions }}可用</text>
						</view>
						<view class="uni-flex-column content">
							<text>{{ item.coupon.name }}</text>
							<text v-if="item.coupon.time_limit_type == 0">领取日内{{ item.coupon.limit_time }}天有效</text>
							<text v-if="item.coupon.time_limit_type == 1">{{ item.coupon.limit_indate_begin }}-{{ item.limit_indate_end }}</text>
						</view>
						<view class="uni-flex-column btns"><text>立即使用</text></view>
					</view>
					<block v-if="unavailablelist.length > 0">
						<text class="coupon_title">不可用优惠券</text>
						<view class="item unavailable uni-flex-row" v-for="item in unavailablelist">
							<view class="uni-flex-column uni-flex-column-center price sm-font ">
								<text class="lg-font">￥{{ item.coupon.denomination }}</text>
								<text>满{{ item.coupon.conditions }}可用</text>
							</view>
							<view class="uni-flex-column content">
								<text>{{ item.coupon.name }}</text>
								<text v-if="item.coupon.time_limit_type == 0">领取日内{{ item.coupon.limit_time }}天有效</text>
								<text v-if="item.coupon.time_limit_type == 1">{{ item.coupon.limit_indate_begin }}-{{ item.limit_indate_end }}</text>
							</view>
							<view class="uni-flex-column">
								<text>{{ allprice > item.coupon.conditions ? '已过期' : '金额不够' }}</text>
							</view>
						</view>
					</block>
				</scroll-view>
				<view class="no_coupon u-m-b-20" @click="initcoupon"><text>不使用优惠券</text></view>
				<view class="l-gap-f" v-if="show_empty"></view>
			</view>
		</u-popup>
		<!-- 确认收货 -->
		<u-popup v-model="showconfirm" ref="orderconfirm" mode="bottom">
			<view class="orderconfirm list u-p-20">
				<scroll-view style="max-height: 50vh;" scroll-y="true">
					<block v-for="(data, index) in clist" :key="index">
						<u-checkbox shape="circle" v-model="data.checked" :disabled="data.status || data.disabled">{{ data.name }}</u-checkbox>
						<view class="item uni-flex-row uni-flex-title" v-for="(item, i) in data.order_commodity" :key="i">
							<view class="uni-flex-row">
								<vimage class="img_box" :src="item.commodity.master" mode=""></vimage>
								<view class="uni-flex-column info_text">
									<text class="u-line-2">{{ item.commodity.name }}</text>
									<text class="sm-font">{{ item.commodity.pvs_value || '' }}</text>
									<view class="uni-flex-row uni-flex-title">
										<text>￥{{ item.money / item.count }}</text>
										<text>x{{ item.count }}</text>
									</view>
								</view>
								<view class="after_status">
									<view v-if="item.after_status != '3' && item.after_status != '4'">维权中,不可收货</view>
									<view v-if="item.status != 3">当前状态不可收货</view>
								</view>
							</view>
						</view>
						<view class="line"></view>
					</block>
				</scroll-view>
				<u-button type="primary" :custom-style="customStyle" size="medium" shape="circle" @click="confirmOrder">确认收货</u-button>
				<!-- <text class="uni-button uni-background-button" ></text> -->
				<view class="l-gap-f" v-if="show_empty"></view>
			</view>
		</u-popup>
		<u-popup v-model="showtype" mode="bottom" v-if="commoditys && commoditys[ac_id]">
			<u-cell-group>
				<u-cell-item v-for="(item, index) in sendtypelist" @click="setSendtype(item.type)" :arrow="false" hover-class="cell-hover-class" :title="item.name">
					<text :class="item.type == commoditys[ac_id].sendtype ? 'active' : ''" class="iconfont el-sc-dui4" slot="right-icon"></text>
				</u-cell-item>
			</u-cell-group>
			<view class="l-gap-f" v-if="show_empty"></view>
		</u-popup>
		<hTimeAlert rangeType title="预约时间" subhead="" rangeDay="5" :isShow="showtime" @closeAlert="gettime"></hTimeAlert>
		<uni-login ref="Login" @callback="logincallback"></uni-login>
		<bind-mobile @hide="hide" :bindshow="bindshow"></bind-mobile>
		<floatmenu page_id="2"></floatmenu>
	</view>
</template>
<script>
import http from '@/common/http.js';
import base from '@/common/baseUrl';
import util from '@/common/util.js';
import {mapState, mapMutations} from 'vuex';
import customfrom from '@/components/customfrom/customfrom';
import hTimeAlert from 'orderpage/components/h-time-alert.vue';
import answer from '@/components/customfrom/answer';
import store from '@/store';
export default {
	onShareAppMessage() {
		return this.wxShare();
	},
	data() {
		return {
			show_empty: false,
			background: {
				backgroundColor: '#ff3c29'
			},
			bindshow: false,
			type: 0,
			showPopupBottom: false,
			showPopupCenter: false,
			showtype: false,
			showconfirm: false,
			showconpon: false,
			ac_id: 0,
			//底层模态框
			popType: 'bottom',
			tabIndex: 0,
			qrcode: '',
			veriflist: [],
			clist: [],
			couponlist: [],
			availablelist: [],
			unavailablelist: [],
			select_id: -1,
			sendinfo: [],
			sendname: ['', '快递', '自提', '同城'],
			sendtypelist: [
				{
					name: '快递',
					type: 1
				},
				{
					name: '自提',
					type: 2
				},
				{
					name: '同城',
					type: 3
				}
			],
			freightlist: [
				{
					freight: 0
				}
			],
			city_freight_list: [], //同城运费
			address: null,
			storelist: {},
			key: 0,
			merchantId: 0,
			selectstoredata: {
				name: '请选择门店',
				address: '',
				district: ''
			},
			selectstoredata_city: {
				name: '请选择门店',
				address: '',
				district: '',
				price: ''
			},
			is_store: false,
			is_integral: false,
			integral: 0,
			ordertype: 1,
			list: [
				{
					checked: false
				},
				{
					checked: false
				},
				{
					checked: false
				}
			],
			integralprice: 0,
			orderdetail: {},
			groupdetial: {},
			form: {
				consignee: '',
				iphone: ''
			},
			sendtype: '',
			remake: '',
			tradeSetting: {},
			integralBalance: {},
			customStyle: {
				width: '690rpx'
			},
			customStyle1: {
				width: '300rpx',
				height: '82rpx',

				'border-radius': '41rpx',
				'font-size': '34rpx',
				color: '#ffffff'
			},
			city_freight_list: [],
			order_form_list: [],
			showtime: false,
			params_time: {
				year: true,
				month: true,
				day: true,
				hour: true,
				minute: true,
				second: false
			},
			delivery_time: '请选择',
			collage_id: '',
			showstatus: true
		};
	},

	components: {
		customfrom,
		answer,
		hTimeAlert
	},
	onReachBottom() {},
	onPullDownRefresh() {
		var _this = this;
		if (this.id) {
			this.judgeLogin(
				() => {
					_this.$store.commit('setlogin', false);
				},
				() => {
					_this.getdetail();
				}
			);
		} else {
			if (!_this.UserInfo.mobile && _this.mallBaseinfo && _this.mallBaseinfo.is_handset) {
				_this.bindshow = true;
			}
			uni.stopPullDownRefresh();
		}
	},

	async onLoad(e) {
		await this.$getWx;
		// #ifdef MP-WEIXIN
		this.show_empty = util.getShowType();
		// #endif
		if (e.type == 1) {
			//详情页进入
			this.type = 0;
			this.ordertype = 1;
			this.sendtype = e.sendtype;
			this.getorderform();
		} else if (e.type == 2) {
			//购物车进入
			this.type = 1;
			this.ordertype = 2;
			this.sendtype = e.sendtype;
			this.getorderform();
		} else if (e.type == 3) {
			//购物车进入（全部）
			this.type = 1;
			this.ordertype = 3;
			this.sendtype = e.sendtype;
		} else if (e.type == 4) {
			//订单详情
			this.type = 2;
			this.id = e.id;
		}

		this.getjuris(['tradeSetting', 'integralBalance']).then(a => {
			this.tradeSetting = a.tradeSetting;
			this.integralBalance = a.integralBalance;
		});
		if (e.sendtype != 'self' && e.type != 4) {
			this.getAddressList();
		}
		if ((e.sendtype == 'self' || e.sendtype == 'all')&&this.addons.indexOf(11)>-1) {
			this.getstorelist();
		}
		var _this = this;
		if (e.type == 1) {
			//详情页进入

			this.getSendInfo();

			this.integraljudge();
		} else if (e.type == 2) {
			//购物车进入

			this.getSendInfo();
			this.integraljudge();
		} else if (e.type == 3) {
			//购物车进入（全部）

			this.getSendInfo();

			this.integraljudge();
		} else if (e.type == 4) {
			//订单详情

			this.judgeLogin(
				() => {
					_this.$store.commit('setlogin', false);
				},
				() => {
					_this.getdetail();
				}
			);
		}
		if (this.addons.indexOf(3) > -1) {
			if (this.type == 1) {
				this.getcoupons();
			}
			if (this.type == 0 && this.commoditys.has_coupon) {
				this.getcoupon();
			}
		}
	},
	onShow(e) {
		// #ifdef MP-WEIXIN
		let pages = getCurrentPages();
		let currPage = pages[pages.length - 1];
		if (currPage.data.address) {
			this.address = currPage.data.address;
			this.hasBuy = true;
		} else {
			this.address = null;
			this.hasBuy = false;
		}
		// #endif

		var _this = this;

		if (this.id) {
			this.judgeLogin(
				() => {
					_this.$store.commit('setlogin', false);
				},
				() => {
					_this.getdetail();
				}
			);
			// this.getdetail();
		} else {
			if (!_this.UserInfo.mobile && _this.mallBaseinfo && _this.mallBaseinfo.is_handset) {
				_this.bindshow = true;
			}
		}
	},

	watch: {
		address() {
			this.shopCartFreight();
		},
		tabIndex() {
			// this.selectstoredata = {
			// 	name: '请选择门店',
			// 	address: '',
			// 	district: ''
			// };
			this.shopCartFreight();
		}
	},
	computed: {
		is_all_store() {
			if (this.commoditys && this.commoditys.length > 0) {
				let list = this.commoditys.filter(a => {
					return a.sendtype == 2;
				});
				return list.length == this.commoditys.length;
			} else {
				return this.mysendtype == 2;
				// this.sendtype == 'all'&&this.tabIndex=
				// return this.sendtype == 'self' || this.tabIndex == 1;
			}
		},
		is_all_address() {
			if (this.commoditys && this.commoditys.length > 0) {
				let list = this.commoditys.filter(a => {
					return a.sendtype == 1;
				});
				return list.length == this.commoditys.length;
			}
		},
		freightall() {
			let freight = 0;
			if (this.commoditys && !Array.isArray(this.commoditys)) {
				if (this.mysendtype == 1) {
					freight = Number(this.freightlist[0].freight);
				}
				if (this.mysendtype == 3 && this.selectstoredata_city.price > -1) {
					// let list = this.city_freight_list.filter(a => a[0] == this.selectstoredata.id);
					// let s_list = list[0][1];
					// let d = s_list.filter(v => v[0][1] == c.id);
					freight = Number(this.selectstoredata_city.price);
				} else {
					// this.selectstoredata_city = {
					// 	name: '请选择门店',
					// 	address: '',
					// 	district: ''
					// };
				}
			} else if (Array.isArray(this.commoditys)) {
				this.commoditys.forEach(a => {
					if (a.sendtype == 3 && Number(a.city_price) >= 0) {
						freight = Number(a.city_price) + freight;
					} else {
						// if (a.merchantId == this.merchantId) {
						// 	a.name = '';
						// 	a.store_id = '';
						// 	a.city_price = '';
						// }
					}
					if (a.sendtype == 1 && this.freightlist.length > 0) {
						let c = this.freightlist.findIndex(_ => _.merchantId == a.merchantId);
						if (c > -1) {
							freight = Number(this.freightlist[c].freight) + freight;
						}
					}
				});
			}
			return freight.toFixed(2);
		},
		goodsprice() {
			let goodsprice = 0;
			if (Array.isArray(this.commoditys)) {
				this.commoditys.forEach((a, i) => {
					a.list.forEach(c => {
						goodsprice = goodsprice + Number(c.price) * Number(c.num);
						if (c.attach && c.attach.length > 0) {
							c.attach.forEach(d => {
								goodsprice = goodsprice + Number(d.price) * Number(c.num);
							});
						}
					});
				});
				return goodsprice.toFixed(2);
			}
		},
		couponprice() {
			if (this.commoditys && !Array.isArray(this.commoditys)) {
				let couponprice = this.commoditys.coupon.denomination ? this.commoditys.coupon.denomination : 0;
				return couponprice.toFixed(2);
			} else if (Array.isArray(this.commoditys)) {
				let couponprice = 0;
				this.commoditys.forEach(a => {
					couponprice = couponprice + (a.coupon.denomination ? a.coupon.denomination : 0);
				});
				return couponprice.toFixed(2);
			} else {
				return '';
			}
		},
		allprice() {
			let allprice = 0;
			if (this.commoditys && !Array.isArray(this.commoditys)) {
				allprice = Number(this.commoditys.price) * Number(this.commoditys.num) + Number(this.freightall) - Number(this.couponprice);
				if (this.commoditys.attach && this.commoditys.attach.length > 0) {
					if (this.commoditys.attach.length > 0) {
						this.commoditys.attach.forEach(d => {
							allprice = allprice + Number(d.price) * Number(this.commoditys.num);
						});
					}
				}
				if (this.is_integral) {
					allprice = allprice - Number(this.integralprice);
				}
				return allprice.toFixed(2);
			} else if (Array.isArray(this.commoditys)) {
				allprice = Number(this.goodsprice) + Number(this.freightall) - Number(this.couponprice);
				if (this.is_integral) {
					allprice = allprice - Number(this.integralprice);
				}
				return allprice.toFixed(2);
			} else {
				return '';
			}
		},
		// 计算发票
		invoiceStatus() {
			let stater = this.orderdetail.invoice ? this.orderdetail.invoice.status : -1;
			if (stater == 1) {
				return '发票正在审核中';
			} else if (stater == 2) {
				return '已开具发票';
			} else if (stater == 3) {
				return '发票审核失败';
			} else if (stater == -1) {
				return '本次不开具发票';
			}
		},
		mysendtype() {
			if (this.sendinfo && this.sendinfo[this.tabIndex]) {
				return this.sendinfo[this.tabIndex].type;
			} else {
				return '';
			}
		},
		...mapState({
			UserInfo: state => state.userInfo,
			commoditys: state => state.commoditys,
			mallBaseinfo: state => state.mallBaseinfo,
			addons: state => state.addons,
			skin: state => state.skin
		})
	},
	filters: {
		getstatus(order, group) {
			if (!group.id) {
				return order.statustext;
			} else {
				if (order.status == 2 && group.status == 1) {
					return '未成团';
				}
				if (order.status == 11 && group.status == 11) {
					return '成团失败';
				}
				return order.statustext;
			}
		},
		getattchtext(list) {
			// let c=''
			let l = [];
			list.forEach(a => {
				l.push(a.name);
			});
			if (l.length > 0) {
				return ' ' + l.join(',');
			} else {
				return '';
			}
		},
		getallprice(c) {
			let goodsprice = Number(c.price) * Number(c.num);
			if (c.attach && c.attach.length > 0) {
				c.attach.forEach(d => {
					goodsprice = goodsprice + Number(d.price) * Number(c.num);
				});
			}
			return goodsprice.toFixed(2);
		}
	},
	methods: {
		togroupdetail() {
			this.Jumpurl({
				type: 1,
				link: '../groupdetial/groupdetial?id=' + this.collage_id,
				login_type: 2
			});
		},
		getgroupdetail(id) {
			this.collage_id = id;
			this.$http('/collage/' + id, {}, 'GET').then(res => {
				this.groupdetial = res.data.msg;
				this.showstatus = true;
			});
		},
		getorderform() {
			this.$http('/order/form/getOrderForm', {}, 'GET').then(res => {
				if (res.data.msg && res.data.msg.config) {
					this.order_form_id = res.data.msg.id;
					this.order_form_list = JSON.parse(res.data.msg.config);
				}
			});
		},
		outdata(data, i) {
			this.order_form_list[i] = data;
		},
		outdata_ones(data, i) {
			this.commoditys.form_list[i] = data;
		},
		outdata_arry(data, arr) {
			let i = arr[2];
			let a = arr[1];
			let c = arr[0];
			this.commoditys[i].list[a].form_list[c] = data;
		},
		async validatfrom(list) {
			if (!list) {
				return false;
			}
			var validat = true;
			var answer = [];
			for (var i = 0; i < list.length; i++) {
				var type = list[i].type;
				var params = list[i].params;
				if (params.required) {
					if (!params.value) {
						if (params.tip) {
							var tip = params.tip;
						} else {
							if (!params.start.value) {
								var tip = params.start.tip;
							} else {
								var tip = params.start.tip;
							}
						}
						uni.showToast({
							title: tip,
							icon: 'none'
						});
						validat = false;
						return false;
					} else {
						if (type == 'mobile' && !this.$u.test.mobile(params.value)) {
							uni.showToast({
								title: params.tip,
								icon: 'none'
							});
							validat = false;
							return false;
						}
						if (type == 'card' && !this.$u.test.idCard(params.value)) {
							uni.showToast({
								title: params.tip,
								icon: 'none'
							});
							validat = false;
							return false;
						}
						answer.push({
							title: params.title,
							value: params.value,
							type: type
						});
					}
				} else {
					if (type == 'mobile' && params.value && !this.$u.test.mobile(params.value)) {
						uni.showToast({
							title: params.tip,
							icon: 'none'
						});
						validat = false;
						return false;
					}
					if (type == 'card' && params.value && !this.$u.test.idCard(params.value)) {
						uni.showToast({
							title: params.tip,
							icon: 'none'
						});
						validat = false;
						return false;
					}
					answer.push({
						title: params.title,
						value: params.value,
						type: type
					});
				}
			}
			return answer;
		},
		//判断提取方式
		getSendInfo() {
			if (Array.isArray(this.commoditys)) {
				var deliver = this.commoditys[0].list[0].deliver;
			} else {
				var deliver = this.commoditys.deliver;
			}
			let list = deliver.split(',');
			list = list.sort((a, b) => {
				return Number(a) - Number(b);
			});
			this.sendinfo = [];
			list.forEach(a => {
				this.sendinfo.push({
					type: Number(a),
					info: {},
					name: this.sendname[a]
				});
			});
		},
		//选定提取方式
		setSendtype(type) {
			let oldtype = this.commoditys[this.ac_id].sendtype;
			this.commoditys[this.ac_id].sendtype = type;
			this.showtype = false;

			if (this.type == 1 && (type == 2 || type == 3) && (oldtype == 2 || oldtype == 3)) {
				let i = this.commoditys.findIndex(_ => _.merchantId == this.merchantId);
				this.commoditys[i].name = '';
				this.commoditys[i].store_id = '';
				this.commoditys[i].city_price = '';
			}
			if (type == 2 && this.type == 1) {
				let i = this.commoditys.findIndex(_ => _.merchantId == this.merchantId);
				if (i > -1 && this.storelist[this.merchantId] && this.storelist[this.merchantId].length > 0) {
					let data = this.storelist[this.merchantId][0];
					if (!this.commoditys[i].store_id) {
						this.commoditys[i].name = data.name;
						this.commoditys[i].store_id = data.id;
						this.commoditys[i].city_price = '';
					}
				}
			}
			this.shopCartFreight();
		},
		//选择提取方式
		selecttype(data, i) {
			this.ac_id = i;
			this.merchantId = data.merchantId;
			this.showtype = true;
		},
		init() {
			this.$refs.slist.afterload();
		},
		hide() {
			this.bindshow = false;
		},
		saveimg(path) {
			let url = util.getimgurl(path);
			// #ifdef MP-WEIXIN
			uni.downloadFile({
				url: url,
				success: res => {
					util.toSaveImage(res.tempFilePath);
				},
				fail() {
					uni.showToast({
						icon: 'none',
						title: '小程序码下载失败'
					});
				}
			});
			// #endif
			// #ifndef MP-WEIXIN
			util.toSaveImage(url);
			// #endif
		},
		logincallback(e) {
			if (e.islogin) {
				this.getdetail();
			} else {
				this.Jumpurl({
					type: 1,
					link: '../index/index',
					login_type: 1
				});
			}
		},
		//计算积分抵扣
		integraljudge() {
			let commodity = [];
			let Coupon = [];
			if (this.type == 0) {
				let c = {
					commodityId: this.commoditys.commodityId,
					sku: this.commoditys.sku,
					count: this.commoditys.num
				};
				if (this.commoditys.attachval) {
					c.attach = this.commoditys.attachval;
				}
				commodity.push(c);
				Coupon.push(this.commoditys.coupon.id);
			} else if (this.type == 1) {
				this.commoditys.forEach(a => {
					Coupon.push(a.coupon.id);
					a.list.forEach(b => {
						let c = {
							commodityId: b.commodityId,
							sku: b.sku,
							count: b.num
						};
						if (b.attachval) {
							c.attach = b.attachval;
						}
						commodity.push(c);
					});
				});
			}
			let total_price = Number(this.allprice) - Number(this.freightall);
			if (this.is_integral) {
				total_price = total_price + Number(this.integralprice);
			}
			let data = {
				commodity: JSON.stringify(commodity),
				total_price: total_price
			};
			if (Coupon.length > 0) {
				data.Coupon = JSON.stringify(Coupon);
			}

			this.$http('/integral/judge', data, 'post').then(res => {
				this.integralprice = res.data.msg.money;
				this.integral = Number(res.data.msg.integral);
				this.userCenter();
			});
		},
		/*优惠券*/
		//获取可用优惠券--购物车
		getcoupons() {
			let param = {};
			let list = this.commoditys;
			if (list && list.length > 0) {
				list.forEach(a => {
					param[a.merchantId] = [];
					a.list.forEach(b => {
						let c = {
							commodity: b.commodityId,
							count: b.num,
							sku: b.sku
						};

						if (b.attachval) {
							c.attach = b.attachval;
						}
						param[a.merchantId].push(c);
					});
				});
				let data = {
					data: JSON.stringify(param)
				};
				http('/user/coupon/commodity', data, 'POST').then(res => {
					if (res.statusCode == 200) {
						this.coupondata = res.data.msg;
						if (this.coupondata.length > 0) {
							this.couponpice();
						}
					}
				});
			}
		},
		//获取可用优惠券--单商品
		getcoupon() {
			let param = {};
			if (this.commoditys && this.commoditys.commodityId) {
				let c = {
					commodity: this.commoditys.commodityId,
					count: this.commoditys.num,
					sku: this.commoditys.sku
				};
				if (this.commoditys.attachval) {
					c.attach = this.commoditys.attachval;
				}
				param[this.commoditys.merchantId] = [c];

				let data = {
					data: JSON.stringify(param)
				};
				http('/user/coupon/commodity', data, 'POST').then(res => {
					if (res.statusCode == 200) {
						this.coupondata = res.data.msg;
						if (this.coupondata.length > 0) {
							this.couponpice();
						}
					}
				});
			}
		},
		//预选优惠券
		couponpice() {
			if (!Array.isArray(this.commoditys)) {
				let merchantId = this.commoditys.merchantId;
				let list = this.coupondata[merchantId].available;
				list = list.sort(this.sortNumber);
				this.commoditys.coupon = list[0].coupon;
			} else if (Array.isArray(this.commoditys)) {
				this.commoditys.forEach(a => {
					let merchantId = a.merchantId;
					let list = this.coupondata[merchantId].available;
					list = list.sort(this.sortNumber);
					a.coupon = list[0].coupon;
				});
			}
		},
		//排序
		sortNumber(a, b) {
			return b.coupon.denomination - a.coupon.denomination;
		},
		//选择优惠券弹窗
		opencoupon(commoditys, i) {
			this.select_id = i;
			if (this.coupondata) {
				let unavailablelist = this.coupondata[commoditys.merchantId].timeOut;
				let availablelist = this.coupondata[commoditys.merchantId].available;
				availablelist.forEach(a => {
					if (a.coupon.id == commoditys.coupon.id) {
						a.checked = true;
					} else {
						a.checked = false;
					}
				});
				this.availablelist = availablelist;
				this.unavailablelist = unavailablelist;
				this.showconpon = true;
			}
		},
		selectcoupon(item) {
			if (this.type == 0) {
				this.commoditys.coupon = item.coupon;
				this.commoditys.coupon_id = item.id;
			} else {
				this.commoditys[this.select_id].coupon = item.coupon;
				this.commoditys[this.select_id].coupon_id = item.id;
			}
			this.integraljudge();
			this.showconpon = false;
			// this.$refs.conpon.close();
		},
		initcoupon() {
			if (this.type == 0) {
				this.commoditys.coupon = {};
				this.commoditys.coupon_id = 0;
			} else {
				this.commoditys[this.select_id].coupon = {};
				this.commoditys[this.select_id].coupon_id = 0;
			}
			this.integraljudge();
			this.$refs.conpon.close();
		},
		/*优惠券end*/

		/*核销*/
		//获取核销二维码
		buildqrcode() {
			let store_id = this.veriflist[0].store_id;
			let data = {
				order: this.id,
				store: store_id
			};
			this.veriflist.forEach((a, i) => {
				if (a.checked) {
					data['ids[' + i + ']'] = a.id;
				}
			});

			http('/order/verification', data, 'POST').then(res => {
				if (res.statusCode == 200) {
					let qrcode = base.imgUrl + res.data.msg.qrcode;
					this.qrcode = qrcode;
					this.showPopupCenter = true;
				}
			});
		},
		//核销弹窗
		showpup() {
			let data = {
				order: this.id
			};
			http('/order/verification', data, 'GET').then(res => {
				if (res.statusCode) {
					let veriflist = res.data.msg;
					veriflist.forEach(a => {
						if (a.status == 2) {
							a.checked = true;
						} else {
							a.checked = false;
						}
					});
					this.veriflist = veriflist;
				}
				this.showPopupBottom = true;
				// this.$refs.popup.open();
			});
		},
		/*核销end*/
		/*链接跳转*/
		//退款单详情
		toafterorder(item) {
			let id = item.after_commodity[0].order_after_id;
			uni.navigateTo({
				url: 'aftersale_detail?id=' + id
			});
		},
		//申请售后
		aftersale(i) {
			uni.navigateTo({
				url: 'aftersale?id=' + i + '&oid=' + this.id
			});
		},
		//快递
		gologistics(item) {
			uni.navigateTo({
				url: 'logistics?id=' + item.logistics_no + '&address=' + this.orderdetail.address
			});
		},
		//获取地址页
		getAddress(obj) {
			if (obj) {
				uni.navigateTo({
					url: '/pages/mine/address/index?addressId=' + obj.id
				});
			} else {
				uni.navigateTo({
					url: '/pages/mine/address/index?addressId=' + 0
				});
			}
		},
		/*链接跳转end*/
		//总价计算
		getallprice() {},

		/*地址*/
		//获得地址列表
		getAddressList() {
			http('/order/userAddressList', {}, 'GET').then(
				res => {
					const json = res.data.msg;
					let list = json.data;

					//判断地址列表是否为空
					if (list.length > 0) {
						let data = list.filter(_ => {
							return _.type == 2;
						});
						if (data.length == 1) {
							this.address = data[0];
							this.form.consignee = data[0].consignee;
							this.form.iphone = data[0].iphone;
						}
					} else {
					}
				},
				e => {
					uni.showModal({
						title: '提示',
						content: e,
						showCancel: false
					});
					uni.hideLoading();
				}
			);
		},
		//运费计算
		shopCartFreight() {
			if (!this.address) {
				return false;
			}

			let payable = true;
			let nendsend = false;
			if (this.type == 0) {
				//详情页进入
				// commoditys = this.commoditys;
				let commoditys = {
					commodityId: this.commoditys.commodityId,
					sku: this.commoditys.sku,
					store_id: this.commoditys.store_id,
					num: this.commoditys.num,
					type: this.commoditys.type,
					merchantId: this.commoditys.merchantId,
					attach: this.commoditys.attachval
				};

				if (this.mysendtype == 1) {
					let data = {
						type: this.ordertype,
						user_address_id: this.address.id,
						commoditys: JSON.stringify(commoditys)
					};
					this.shopFreight(data);
				} else if (this.mysendtype == 3) {
					let data = {
						user_address_id: this.address.id,
						commodity_id: commoditys.commodityId,
						num: commoditys.num,
						sku: this.commoditys.sku
					};

					this.cityFreight(data);
				}
			} else {
				let commoditys = [];
				let citylist = [];
				//购物车进入
				this.commoditys.forEach(a => {
					if (a.sendtype == 1) {
						a.list.forEach(b => {
							commoditys.push({
								id: b.commodityId,
								sku: b.sku,
								num: b.num,
								type: a.sendtype,
								store_id: a.store_id,
								sendtype: a.sendtype,
								attach: b.attachval
							});
						});
					} else if (a.sendtype == 3) {
						let d = [{merchant_id: a.merchantId}];
						let c = [];
						a.list.forEach(b => {
							c.push({
								id: b.commodityId,
								sku: b.sku,
								num: b.num,
								type: a.sendtype,
								store_id: a.store_id,
								sendtype: a.sendtype,
								attach: b.attachval
							});
						});
						d.push(c);
						citylist.push(d);
					}
				});
				let data = {
					type: this.ordertype,
					user_address_id: this.address.id
				};
				let data1 = {
					user_address_id: this.address.id
				};
				data.commoditys = JSON.stringify(commoditys);
				if (citylist.length > 0) {
					data1.commoditys = JSON.stringify(citylist);
				} else {
					data1.commoditys = JSON.stringify(commoditys);
				}

				if (commoditys && commoditys.length > 0) {
					this.shopFreight(data);
				}

				if (citylist.length > 0) {
					this.goodsCityFreight(data1);
				}
			}
		},
		// 快递运费
		shopFreight(data) {
			http('/order/shopCartFreight', data, 'POST').then(res => {
				if (res.statusCode == 200) {
					let list = res.data.msg;
					this.freightlist = list;
				} else {
					uni.showToast({
						title: res.data.msg
					});
				}
			});
		},

		// 单商品同城运费
		cityFreight(data) {
			http('/order/cityFreight', data, 'POST').then(res => {
				if (res.statusCode == 200) {
					let city_freight_list = [];
					let list = res.data.msg;
					city_freight_list.push(this.commoditys.merchantId);
					city_freight_list.push(list);
					let c_list = [];
					c_list.push(city_freight_list);
					uni.setStorageSync('city_freight_list', JSON.stringify(c_list));
					this.city_freight_list = c_list;
					this.getpricestorlist({}, 1);
				} else {
					uni.showToast({
						title: res.data.msg
					});
				}
			});
		},
		// 多商品同城运费
		goodsCityFreight(data1) {
			http('/order/goodsCityFreight', data1, 'POST').then(res => {
				if (res.statusCode == 200) {
					let city_freight_list = res.data.msg;
					uni.setStorageSync('city_freight_list', JSON.stringify(city_freight_list));
					this.city_freight_list = city_freight_list;
					this.getpricestorlist(data1, 2);
				} else {
					uni.showToast({
						title: res.data.msg
					});
				}
			});
		},
		getpricestorlist(data, type) {
			let city_freight_list = this.city_freight_list;
			if (type == 1) {
				let id = this.commoditys.merchantId;
				let alist = city_freight_list.filter(a => a[0] == id);
				let s_list = alist[0][1];
				let list = this.storelist[id];
				list.forEach(c => {
					let d = s_list.filter(v => v[0][1] == c.id);
					if (d.length > 0) {
						if (Number.isNaN(Number(d[0][1]))) {
							c.price = -1;
						} else {
							c.price = d[0][1];
						}
					} else {
						c.price = -1;
					}
				});
				let mlist = list.filter(_ => _.price != -1);
				let nlist = mlist.sort((a, b) => {
					return a.price - b.price;
				});
				this.selectstoredata_city = nlist[0]
					? nlist[0]
					: {
							name: '请选择门店',
							address: '',
							district: ''
					  };
			} else {
				
				let list = JSON.parse(data.commoditys);
				list.forEach(a => {
					let id = a[0].merchant_id;
					this.getpricestoritem(id);
				});
			}
		},
		getpricestoritem(id) {
			let city_freight_list = this.city_freight_list;
			let alist = city_freight_list.filter(a => a[0] == id);
			let s_list = alist[0][1];
			let list = this.storelist[id];
			list.forEach(c => {
				let d = s_list.filter(v => v[0][1] == c.id);
				if (d.length > 0) {
					if (Number.isNaN(Number(d[0][1]))) {
						c.price = -1;
					} else {
						c.price = d[0][1];
					}
				} else {
					c.price = -1;
				}
			});
			let mlist = list.filter(_ => _.price != -1);
			let nlist = mlist.sort((a, b) => {
				return a.price - b.price;
			});
			let i = this.commoditys.findIndex(_ => _.merchantId == id);
			if (nlist.length > 0) {
				// if (!this.commoditys[i].store_id) {
					this.commoditys[i].city_price = nlist[0].price;
					this.commoditys[i].store_id = nlist[0].id;
					this.commoditys[i].name = nlist[0].name;
				// }
			} else {
				this.commoditys[i].city_price = '';
				this.commoditys[i].store_id = '';
				this.commoditys[i].name = '';
			}
			// this.selectstoredata_city = nlist[0]
			// 	? nlist[0]
			// 	: {
			// 			name: '请选择门店',
			// 			address: '',
			// 			district: ''
			// 	  };
		},
		getstorelist() {
			if (this.type == 0) {
				this.getstore(this.commoditys, 1);
			} else if (this.type == 1) {
				this.commoditys.forEach(a => {
					this.getstore(a, 2);
				});
			}
		},
		getstore(item, type) {
			let data = {
				merchant_id: item.merchantId
			};
			http('/merchant/store/list?page=1&size=100', data, 'POST').then(res => {
				if (res.statusCode == 200) {
					let list = res.data.msg.data;
					this.storelist[item.merchantId] = list;
					uni.setStorageSync('storelist', JSON.stringify(this.storelist));
					if (list.length > 0) {
						if (type == 1) {
							this.selectstoredata = list[0];
						} else if (type == 2) {
							let store = list[0];
							this.commoditys.forEach(a => {
								if (a.merchantId == item.merchantId) {
									a.name = store.name;
									a.store_id = store.id;
									// a.city_price = store.price;
								}
							});
						}
					}
				}
			});
		},

		//选择门店
		selectstore(item, t) {
			if (t == 3) {
				item.sendtype = 3;
			}
			if (t == 2) {
				item.sendtype = 2;
			}
			if (item.sendtype == 3 && !this.address) {
				uni.showToast({
					icon: 'none',
					title: '请先选择收货地址'
				});
				return false;
			}
			if (this.storelist[item.merchantId] && this.storelist[item.merchantId].length > 0) {
				uni.navigateTo({
					url: '/pages/mine/storelist/storelist?id=' + item.merchantId + '&sendtype=' + item.sendtype
				});
			} else {
				let data = {
					merchant_id: item.merchantId
				};
				http('/merchant/store/list?page=1&size=100', data, 'POST').then(res => {
					if (res.statusCode == 200) {
						let list = res.data.msg.data;
						if (list.length > 0) {
							this.storelist[item.merchantId] = list;
							uni.setStorageSync('storelist', JSON.stringify(this.storelist));
							uni.navigateTo({
								url: '/pages/mine/storelist/storelist?id=' + item.merchantId + '&sendtype=' + item.sendtype
							});
						}
					}
				});
			}
		},
		// 门店选择返回
		Editcart(item, id) {
			if (this.type != 1) {
				return false;
			}
			this.commoditys.forEach(a => {
				if (a.merchantId == id) {
					a.name = item.name;
					a.store_id = item.id;
					a.city_price = item.price;
				}
			});
		},
		//
		opmap() {
			let latitude = this.orderdetail.order_commodity[0].store.latitude;
			let longitude = this.orderdetail.order_commodity[0].store.longitude;
			uni.openLocation({
				latitude: latitude,
				longitude: longitude,
				success: function() {}
			});
		},
		async getform() {
			let form_config = [];
			let commoditys = this.commoditys;
			if (this.order_form_list && this.order_form_list.length > 0) {
				let answer = await this.validatfrom(this.order_form_list);
				if (!answer) {
					return false;
				} else {
					form_config.push({
						template_id: this.order_form_id,
						source: 0,
						answer: answer
					});
				}
			}
			if (Array.isArray(commoditys)) {
				for (var i = 0; i < commoditys.length; i++) {
					let list = commoditys[i].list;
					for (var c = 0; c < list.length; c++) {
						let commoditys = list[c];
						if (commoditys.form_list) {
							let answer = await this.validatfrom(commoditys.form_list);
							if (!answer) {
								return false;
							} else {
								form_config.push({
									template_id: commoditys.template_id,
									source: 1,
									commodity_id: commoditys.commodityId,
									answer: answer
								});
							}
						}
					}
				}
			} else {
				if (commoditys.form_list && commoditys.form_list.length > 0) {
					let answer = await this.validatfrom(commoditys.form_list);
					if (!answer) {
						return false;
					} else {
						form_config.push({
							template_id: commoditys.template_id,
							source: 1,
							commodity_id: commoditys.commodityId,
							answer: answer
						});
					}
				}
			}
			return form_config;
		},
		//新建订单
		async createOrder() {
			let coupons = [];
			let commoditys = [];
			let form_config = await this.getform();
			if (!form_config) {
				return false;
			}

			let payable = true;
			let nendsend = false;
			if (!this.UserInfo.mobile && this.mallBaseinfo.is_handset) {
				this.bindshow = true;
				return false;
			}
			if (this.type == 0) {
				commoditys = this.commoditys;

				let data = {
					merchant_id: commoditys.merchantId,
					coupon_id: commoditys.coupon_id
				};

				if (data.coupon_id) {
					coupons.push(data);
				}
				if (this.mysendtype == 1) {
					if (!this.address) {
						uni.showToast({
							title: '请选择收货地址',
							icon: 'none'
						});
						return false;
					}
					commoditys.type = 1;
					delete commoditys.store_id;
				} else if (this.mysendtype == 2) {
					if (this.selectstoredata && this.selectstoredata.id) {
						commoditys.type = 2;
						commoditys.store_id = this.selectstoredata.id;
					} else {
						uni.showToast({
							title: '请选择门店',
							icon: 'none'
						});
						return false;
					}
				} else if (this.mysendtype == 3) {
					if (!this.address) {
						uni.showToast({
							title: '请选择收货地址',
							icon: 'none'
						});
						return false;
					}
					if (!this.selectstoredata_city) {
						uni.showToast({
							title: '请选择门店',
							icon: 'none'
						});
						return false;
					}
					commoditys.type = 3;
					commoditys.store_id = this.selectstoredata_city.id;
				}

				commoditys = {
					commodityId: commoditys.commodityId,
					sku: commoditys.sku,
					store_id: commoditys.store_id,
					num: commoditys.num,
					type: commoditys.type,
					merchantId: commoditys.merchantId,
					attach: commoditys.attachval,
					group_level: commoditys.group_level,
					collage_id: commoditys.collage_id
				};

				// commoditys.attach=commoditys.attachval
			} else {
				if (
					this.commoditys.findIndex(a => {
						return a.sendtype != 1 && !a.store_id;
					}) != -1
				) {
					uni.showToast({
						title: '请选择门店',
						icon: 'none'
					});
					return false;
				}
				this.commoditys.forEach(a => {
					let data = {
						merchant_id: a.merchantId,
						coupon_id: a.coupon_id
					};
					if (data.coupon_id) {
						coupons.push(data);
					}
					a.list.forEach(b => {
						commoditys.push({
							id: b.commodityId,
							sku: b.sku,
							num: b.num,
							type: a.sendtype,
							store_id: a.store_id,
							attach: b.attachval
						});
					});
				});
			}
			let data = {
				type: this.ordertype,
				commoditys: JSON.stringify(commoditys),
				is_integral: this.is_integral ? 1 : 0
			};
			if (coupons.length > 0) {
				data.coupons = JSON.stringify(coupons);
			}

			if (!this.is_all_store) {
				if (this.address) {
					data.user_address_id = this.address.id;
				} else {
					uni.showToast({
						title: '请选择收获地址',
						icon: 'none'
					});
					return false;
				}
			} else {
				data.consignee = this.form.consignee;
				data.iphone = this.form.iphone;

				if (!data.consignee) {
					uni.showToast({
						title: '请填写自提人姓名',
						icon: 'none'
					});
					return false;
				}
				if (!this.$u.test.mobile(data.iphone)) {
					uni.showToast({
						title: '请填写正确的自提人手机号',
						icon: 'none'
					});
					return false;
				}
			}

			data.remake = this.remake;
			if (form_config.length && form_config.length > 0) {
				data.form_config = JSON.stringify(form_config);
			}
			if (this.delivery_time != '请选择') {
				data.delivery_time = this.delivery_time;
			}
			if (this.commoditys.is_group) {
				data.type = 4;
			}
			if (this.commoditys.is_seckill) {
				data.type = 5;
			}
			if (this.commoditys.is_presell) {
				data.type = 6;
			}
			http('/order/createOrder', data, 'POST').then(res => {
				if (res.statusCode == 200) {
					store.commit('setCommoditys', null);
					if (this.is_integral) {
						this.userCenter();
					}
					let list = res.data.msg;
					let price = 0;
					let arr = [];
					list.forEach(a => {
						arr.push(a.order_no);
						price = util.accAdd(a.money, price);
						price = util.accAdd(a.freight, price);
						if (a.discount_amount) {
							price = util.Subtr(price, Number(a.discount_amount));
						}
						price = util.Subtr(price, a.coupon_money);
					});

					arr = arr.join(',');
					uni.redirectTo({
						url: 'pay?list=' + arr + '&total=' + price
					});
				} else {
					uni.showToast({
						title: res.data.msg,
						icon: 'none'
					});
				}
			});
		},
		userCenter() {
			let params = {};
			this.$http('/user/UserCenter', params, 'GET').then(res => {
				let centerinfo = res.data.msg;
				let myUserInfo = Object.assign({}, this.UserInfo, centerinfo);
				this.$store.commit('setUserInfo', myUserInfo);
			});
		},
		//前往支付
		topay() {
			let list = [];
			list.push(this.orderdetail.order_no);
			list = list.join(',');
			let money = this.orderdetail.money;

			uni.navigateTo({
				url: 'pay?total=' + money + '&list=' + list
			});
		},
		gettime(data) {
			this.delivery_time = data.dateRange;
			this.showtime = false;
		},
		//订单详情
		getdetail() {
			http('/order/readOrder/' + this.id, {}, 'GET').then(res => {
				uni.stopPullDownRefresh();
				if (res.statusCode == 200) {
					let orderdetail = res.data.msg;
					if (orderdetail.form && orderdetail.form.answer) {
						orderdetail.form.answer = JSON.parse(orderdetail.form.answer);
					}
					// let freight = orderdetail.freight || 0;
					// orderdetail.freight = freight.toFixed(2);
					if (orderdetail.order_type == 3) {
						orderdetail.money = Number(orderdetail.money) - Number(orderdetail.distribution_fee);
						orderdetail.freight = orderdetail.distribution_fee.toFixed(2);
					}
					let allprice = Number(orderdetail.money) - Number(orderdetail.discount) - Number(orderdetail.discount_amount) + Number(orderdetail.freight);
					orderdetail.allprice = allprice.toFixed(2);

					let orderCommodity = orderdetail.order_commodity;
					orderCommodity.forEach(item => {
						if (item.form && item.form.answer) {
							item.form.answer = JSON.parse(item.form.answer);
						}
					});
					if (orderCommodity[0].collage_id) {
						this.getgroupdetail(orderCommodity[0].collage_id);
						this.showstatus = false;
					}
					orderdetail.statustext = util.getstatustext(orderdetail.status, orderdetail.order_type);
					if (orderCommodity.findIndex(_ => _.status == 3) > -1) {
						orderdetail.send = 1;
					}
					if (orderdetail.attach && orderdetail.attach.length > 0) {
						orderCommodity.forEach(item => {
							item.attachlist = [];
							if (item.attach_value) {
								orderdetail.attach.forEach(a => {
									if (item.attach_value.indexOf(a.attach_value) > -1 && item.attachlist.findIndex(_ => _.attach_value == a.attach_value) == -1) {
										item.attachlist.push(a);
									}
								});
							}
						});
					}
					this.orderdetail = orderdetail;
				} else {
					uni.showToast({
						title: res.data.error_msg,
						icon: 'none'
					});
				}
			});
		},
		//bf_orderconfirm
		bf_orderconfirm() {
			let list = this.orderdetail.order_commodity;
			let _temp = [];
			let clist = [];

			if (this.orderdetail.order_type == 1) {
				list.forEach(e => {
					if (e.logistics_no && _temp.findIndex(_ => _.logistics_no == e.logistics_no) == -1) {
						_temp.push({
							express_company: e.express_company,
							logistics_no: e.logistics_no
						});
					}
				});

				//重构包裹清单
				if (_temp.length > 0) {
					_temp.forEach((e, i) => {
						let alist = list.filter(_ => _.logistics_no == e.logistics_no);
						let b = alist.filter(_ => {
							return _.after_status != '3' && _.after_status != '4';
						});
						let c = alist.filter(_ => _.status == 3);
						// let b = alist.filter(_ => _.after_status != '3');
						// if(b.length==alist.length)
						// let disabled=b>-1
						clist.push({
							name: '包裹' + (i + 1),
							order_commodity: alist,
							checked: !(b.length == alist.length) && !(c.length == 0),
							disabled: !!(c.length == 0),
							status: !!(b.length == alist.length)
						});
					});
				}
			} else {
				let b = list.filter(_ => {
					return _.after_status != '3' && _.after_status != '4';
				});
				let c = list.filter(_ => _.status == 3);
				clist.push({
					name: '包裹1',
					order_commodity: list,
					checked: !(b.length == list.length) && !(c.length == 0),
					disabled: !!(c.length == 0),
					status: !!(b.length == list.length)
				});
			}

			this.clist = clist;
			// this.$refs.orderconfirm.open();
			this.showconfirm = true;
		},
		//确认收货
		confirmOrder() {
			var _this = this;
			this.showconfirm = false;
			uni.showModal({
				title: '是否确认收货',
				success(res) {
					if (res.confirm) {
						let cids = [];
						_this.clist.forEach(a => {
							if (a.checked) {
								a.order_commodity.forEach(a => {
									if (a.status == 3 && (a.after_status == '3' || a.after_status == '4')) {
										cids.push(a.id);
									}
								});
							}
						});
						if (cids.length == 0) {
							uni.showToast({
								icon: 'none',
								title: '沒有可以收货的商品！'
							});
							return false;
						}
						let param = {
							id: _this.id,
							cids: JSON.stringify(cids)
						};
						http('/order/confirm', param, 'PUT').then(res => {
							if (res.statusCode == 200) {
								_this.getdetail();
							} else {
								uni.showToast({
									title: res.data.msg
								});
							}
						});
					}
				}
			});
		},
		//订单评价
		evaluateOrder() {
			uni.navigateTo({
				url: 'evaluate?id=' + this.id
			});
		},
		changecheck(item) {
			item.checked = !item.checked;
		},
		uniCopy(text) {
			util.uniCopy({
				content: text,
				success: res => {
					uni.showToast({
						title: res,
						icon: 'none'
					});
				},
				error: e => {
					uni.showToast({
						title: e,
						icon: 'none',
						duration: 3000
					});
				}
			});
		},
		//切换
		changePopup(e) {
			this.showPopupBottom = e.show;
		},
		changetabs(tabid) {
			if (this.sendtype == 'self') return;
			this.tabIndex = tabid;
		},

		changeTab(e) {
			let index = e.detail.current;
			this.tabIndex = index;
		},
		// 开具发票
		todetail() {
			if (this.orderdetail.invoice) {
				if (this.orderdetail.invoice.status == 2 || this.orderdetail.invoice.status == 1) {
					return false;
				}
			}
			uni.navigateTo({
				url: '../../pages/mine/invoice/detail?id=' + this.id
			});
		},
		topdetail(id) {
			this.Jumpurl({
				type: 2,
				id: id
			});
		}
	}
};
</script>

<style lang="scss">
.order_container {
	height: calc(100vh - 90rpx);
	height: -webkit-calc(100vh - 90rpx);
}

.status_text {
	font-size: 48rpx;
	font-weight: bold;
}

.app {
	padding-top: 0rpx;

	&.top_no {
		padding-top: 0;
	}
}

.banner {
	background: #ff3c29;
	width: 750rpx;
	height: 160rpx;
	position: absolute;
	top: 0;
	z-index: 1;
}

.adress_div {
	width: 750rpx;
	background-color: #fff;
	position: relative;
	z-index: 2;
	border-radius: 12rpx;
	background: #f4f4f4;

	.addressline {
		width: 702rpx;
	}

	.item {
		padding: 15rpx 0rpx;
		margin: 0 20rpx;

		.label {
			width: 120rpx;
			font-size: 30rpx;
		}

		input {
			font-size: 24rpx;
			margin-left: 20rpx;
		}
	}

	.tabs {
		display: flex;
		align-items: center;
		border-bottom: 1rpx solid #f5f5f5;
		width: 750rpx;
		height: 88rpx;
		background: #ffffff;

		.active {
			color: var(--main-color);

			text {
				border-bottom: 4rpx solid var(--main-color);
			}
		}

		view {
			flex: 1;
			text-align: center;
			font-size: 30rpx;
			font-weight: 500;

			text {
				padding: 0 65rpx;
				line-height: 80rpx;
				display: inline-block;
				border-bottom: 4rpx solid #ffffff;
			}
		}
	}

	.adresslist {
		width: 710rpx;
		margin: 0 auto;
		height: 178rpx;
		margin-top: 20rpx;

		.uni-swiper {
			height: 178rpx;
			border-radius: 16rpx;
			position: relative;
			background: #ffffff;
		}
	}

	.address_info {
		font-size: 26rpx;
		color: #969696;
		padding: 0 24rpx;
		height: 178rpx;
		background: #ffffff;
		border-radius: 16rpx;

		.add_name {
			margin-bottom: 10rpx;

			text:first-child {
				font-size: 30rpx;
				font-weight: bold;
				color: #333333;
				margin-right: 18rpx;
			}
		}

		.el-sc-dingwei {
			// margin-right: 20rpx;
			font-size: 34rpx;
			color: #333333;
			// margin-right: 10rpx;
		}

		.icon_div {
			width: 66rpx;
			height: 66rpx;
			background: var(--main-color);
			border-radius: 50%;
			display: flex;
			align-items: center;
			justify-content: center;
			margin-right: 27rpx;

			.el-sc-dingwei {
				// margin-right: 20rpx;
				font-size: 34rpx;
				color: #ffffff;
			}
		}
	}

	.line {
		width: 100%;
		height: 1rpx !important;
		background-color: #f5f5f5;
	}
}

.user_info {
	background: #ffffff;
	width: 710rpx;
	margin: 20rpx auto;
	padding: 0 24rpx;
	border-radius: 16rpx;
}

.list {
	.item {
		font-size: 30rpx;
		color: #333;
		border-bottom: 1rpx solid #f5f5f5;
		padding: 20rpx 0;
		margin-bottom: 20rpx;

		/deep/.img_box {
			width: 140rpx;
			height: 140rpx;
			border-radius: 8rpx;
			margin-right: 10rpx;
		}

		.info_text {
			// flex: 1;
			font-size: 28rpx;
			justify-content: space-between;
			height: 140rpx;
			padding-left: 20rpx;
			align-items: flex-start;

			.sm-font {
				color: #888;
				font-size: 24rpx;
			}
		}

		.iconfont {
			font-size: 40rpx;
		}

		.active {
			.iconfont {
				color: #ff3c29;
			}
		}
	}
}

.merchantName {
	// width: 702rpx;
	background-color: #fff;
	font-size: 30rpx;
	padding: 20rpx;
	border-bottom: 1rpx solid #f5f5f5;
}

.good_box {
	width: 702rpx;
	margin: 10rpx auto;
	// position: relative;
	// z-index: 2;
	background-color: #fff;
	border-radius: 12rpx;
	overflow: hidden;

	/deep/.u-cell {
		padding: 16rpx 20rpx;
	}

	.item {
		padding: 10rpx 20rpx;
	}

	.fuzhi {
		text-decoration: underline;
		margin-left: 15rpx;
		color: #ff3c29;
	}

	font-size: 30rpx;
}

.goodinfo {
	// position: relative;
	// z-index: 2;
	width: 702rpx;
	background-color: #fff;
	// margin: 0rpx 32rpx;
	padding: 20rpx;
	font-size: 30rpx;
	border-bottom: 1rpx solid #f5f5f5;
	border-radius: 16rpx;

	// .img_box {
	// 	width: 140rpx;
	// 	height: 140rpx;
	// 	border-radius: 6rpx;
	// }

	// .goods_content {
	// 	width: 320rpx;
	// 	height: 140rpx;
	// 	justify-content: space-between;
	// 	margin-left: 20rpx;
	// }

	.info_text {
		height: 180rpx;
		font-size: 28rpx;

		// justify-content: space-between;
		&.name {
			flex: 1;
		}

		.u-line-2 {
			// height: 80rpx;
			line-height: 1.2;
		}

		text:nth-child(2) {
			margin-top: 10rpx;
			margin-left: 8rpx;
		}

		.status {
		}

		&.price {
			margin-left: 30rpx;
			align-items: flex-end;

			text:first-child {
				font-size: 28rpx;
				font-weight: 500;
				color: #333333;
				// line-height: 34px;
			}

			text:last-child {
				font-size: 26rpx;
				font-weight: 500;
				color: #999999;
			}
		}

		.sm-font {
			color: #888;
			font-size: 24rpx;
			// margin-top: 18rpx;
		}
	}

	.item {
		padding: 20rpx 0 0 0;
	}

	.evanswitch {
		transform: scale(0.6);
	}
}

.btns {
	font-size: 24rpx;
	padding: 10rpx 0rpx;

	button {
		margin-left: 10rpx;
		background: #fff;
		color: #ff3c29;
	}
}

.goods_list {
	width: 710rpx;
	background-color: #fff;
	margin: 20rpx auto;
	border-radius: 16rpx;
	padding: 40rpx 0 0 0;

	.title {
		font-size: 30rpx;
		font-weight: bold;
		color: #333333;
		padding: 0 20rpx;
	}
}
.goods_div {
	position: relative;
	z-index: 2;
	padding: 30rpx 20rpx;
	font-size: 30rpx;
	border-bottom: 1rpx solid #f5f5f5;

	/deep/.img_box {
		width: 140rpx;
		height: 140rpx;
		border-radius: 8rpx;
	}

	.goods_content {
		width: 320rpx;
		height: 140rpx;
		justify-content: space-between;
		margin-left: 20rpx;

		text:first-child {
			font-size: 26rpx;
			color: #333333;
		}

		text:nth-child(2) {
			font-size: 20rpx;
		}

		text:last-child {
			font-size: 26rpx;
			color: #999999;
			font-weight: bold;
		}
		.group_div {
			background: var(--main-color);
			color: #fff !important;
			padding: 2rpx 5rpx;
			border-radius: 10rpx;
			margin-right: 5rpx;
		}
	}

	.goods_price {
		flex: 1;
		align-items: flex-end;
		// justify-content: space-between;
		height: 140rpx;

		text:first-child {
			font-size: 26rpx;
			font-weight: bold;
			color: #333333;
		}

		text:nth-child(2) {
			font-size: 24rpx;
			font-weight: 500;
			color: var(--main-color);
			margin-top: 10rpx;
		}

		.btns {
			background: #ffffff;
			border: 1rpx solid var(--main-color);
			border-radius: 25rpx;
			font-size: 24rpx;
			font-weight: 500;
			color: var(--main-color);
			padding: 6rpx 12rpx;
			text-align: center;
			margin-left: 15rpx;
		}
	}

	.goods_btns {
		position: absolute;
		right: 0;
		display: flex;
		width: 100%;
		bottom: 0rpx;
		justify-content: flex-end;
	}
}
.order_detial {
	width: 710rpx;
	background-color: #fff;
	margin: 20rpx auto;
	border-radius: 16rpx;
	padding: 40rpx 30rpx;

	.title {
		font-size: 30rpx;
		font-weight: bold;
		color: #333333;
		display: block;
		margin-bottom: 15rpx;
	}
}

.order_cell {
	padding: 15rpx 0;
	color: #999999;

	&.boldtext {
		color: #333333;
		font-weight: bold;
	}

	.fuzhi {
		text-decoration: underline;
		margin-left: 15rpx;
		color: #ff3c29;
	}
}

.footer {
	// padding: 20rpx;
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: #fff;
	font-size: 30rpx;
	z-index: 20;
	padding: 0 32rpx;
	min-height: 70rpx;

	.allprice {
		text:first-child {
			// font-size: 36rpx;
		}
	}

	button {
		height: 54rpx;
		background: var(--main-color);
		border-radius: 27rpx;
		color: #fff !important;
	}
}

.pay_price {
	color: #ff3c29;
	font-weight: 700;
	margin-left: 10rpx;
}

.weizhi {
	margin: 10rpx auto;
}

.mt_5 {
	margin-top: 10rpx;
}

.qrcodediv {
	width: 551rpx;
	height: 627rpx;
	background: #ffffff;

	background: #fff;
	padding-top: 20rpx;
	display: flex;
	flex-direction: column;
	align-items: center;

	.qrcode_top {
		width: 100%;
		padding: 0 20rpx;
		font-size: 32rpx;

		.el-sc-cuo11 {
			font-size: 36rpx;
		}
	}

	image {
		margin-top: 40rpx;
		width: 280rpx;
		height: 280rpx;
	}

	> text {
		text-align: center;
		margin-top: 20rpx;
		font-size: 34rpx;
		color: #999999;
	}

	.qrcode_btn {
		// width: 300rpx;
		// height: 82rpx;
		// background: linear-gradient(90deg, #fe8e0a, #ff5011);
		// box-shadow: -2px 5px 9px 0px rgba(254, 140, 10, 0.5);
		// border-radius: 41rpx;
		// font-size: 34rpx;
		// color: #ffffff;
		margin-top: 54rpx;
	}
}

/* 弹窗优惠券 */

.couponlist {
	height: 50vh;

	.item {
		background: #fde2e2;
		height: 160rpx;
		border-radius: 12rpx;
		margin-bottom: 20rpx;

		.price {
			width: 160rpx;
			height: 160rpx;
			justify-content: center;
			background: #ff3c29;
			color: #fff;
		}

		.content {
			width: 360rpx;
			padding-left: 20rpx;
			font-size: 24rpx;
			height: 80rpx;
			justify-content: space-between;
		}

		.btns {
			background-color: #ff3c29;
			color: #fff;
			width: 140rpx;
			font-size: 26rpx;
			text-align: center;
			padding: 10rpx 0;
			border-radius: 27rpx;
		}
	}

	.coupon_title {
		margin-bottom: 10rpx;
		display: block;
	}

	.unavailable {
		&.item {
			background: #f5f5f5;
		}

		.price {
			background: #808080;
		}
	}
}

.coupontxt {
	color: #ff3c29;
}

.nocoupon {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100%;

	.btns {
		margin-top: 30rpx;
		background-color: #ff3c29;
		color: #fff;
		width: 280rpx;
		font-size: 26rpx;
		text-align: center;
		padding: 10rpx 0;
		border-radius: 27rpx;
	}
}

.orderconfirm {
	background-color: #fff;
	// width: 600rpx;
	border-radius: 12rpx;

	.active {
		color: #ff3c29;
	}

	.item {
		border: none;

		.info_text {
			width: 400rpx;

			.uni-flex-title {
				width: 100%;
			}
		}
	}

	.line {
		width: 536rpx;
		margin-left: 32rpx;
	}

	.uni-button {
		margin: 16rpx auto;
	}

	.check_div {
		display: flex;
		margin: 0 32rpx;
		padding: 16rpx 0;
		align-items: center;
		border-bottom: 1rpx solid #f5f5f5;

		view {
			margin-right: 16rpx;

			text {
				font-size: 40rpx;
			}
		}
	}
}

.store-ad {
	position: relative;
	align-items: center;
	display: flex;

	image {
		right: 0;
		top: 0;
		position: absolute;
		width: 80rpx;
		height: 80rpx;
		z-index: 1;
		background: #0077aa;
	}

	text {
		position: relative;
		z-index: 2;
	}

	// width: 80rpx;
	height: 80rpx;
}

.status_div {
	position: relative;
	// width: 750rpx;
	margin: 0 auto;
	// background: #ff3c29;
	// border-radius: 12rpx;
	width: 750rpx;
	height: 248rpx;
	background: var(--main-color);

	color: #fff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	// padding: 16rpx 48rpx;
	padding: 0 55rpx;

	.image {
		width: 120rpx;
		height: 120rpx;
		margin-right: 24rpx;
	}

	// height:
}

.popup_div {
	max-height: 50vh;
}
.after_status {
	color: red;
	flex: 1;
	display: flex;
	align-items: self-start;
	height: 140rpx;
	font-size: 24rpx;
	/* text-align: right; */
	justify-content: flex-end;
}
.active {
	color: #ff3c29;
}
.no_coupon {
	text-align: center;
	// text{
	// 	text-decoration: line-through;
	// }
}
.attach-txt {
	.attach-item {
		padding: 10rpx 0;
		.attach-price {
		}
	}
}
.form_div {
	width: 702rpx;
	margin: 10rpx auto;
	border-radius: 12rpx;
	overflow: hidden;
	/deep/.form-templates {
		padding: 16rpx 20rpx;
	}
}
.form_div_cart {
	/deep/.form-templates {
		padding: 0;
	}
}
</style>
